<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>VUE【MVVM设计模式】</title>
		<script type="text/javascript" src="../vue.js" ></script>
	</head>
	<body>
		<div id = "app"> 
			<img src="../img/day03.png" width="500px" height="500px"/>
			<br/>
			<input type = "text" v-model="inputValue" />
			<button v-on:click="handleBtnClick">提交</button>
			<ul>
				<li v-for = "item of list">{{item}}</li>
			</ul>
		</div>
	</body>
	<script>
		  var app = new Vue({
		  	el : "#app",
		  	data : {
		  		list : [],
		  		inputValue : ''
		  	},
		  	methods : {
		  		handleBtnClick : function(){
		  			if(this.inputValue != ''){
		  				this.list.push(this.inputValue);
		  				this.inputValue = '';
		  			}
		  		}
		  	}
		  });
	</script>
</html>
